package com.loto.rpc.controller;

import com.loto.rpc.api.IUserService;
import com.loto.rpc.pojo.User;
import com.loto.rpc.proxy.RpcClientProxy;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author：蓝田_Loto
 * <p>Date：2021-10-16 18:50</p>
 * <p>PageName：UserController.java</p>
 * <p>Function：</p>
 */

@RestController
public class UserController {
    // http://localhost:8080/user
    @RequestMapping("/user")
    public void demo() {
        IUserService userService = (IUserService) RpcClientProxy.createProxy(IUserService.class);
        User user = userService.getById(1);
        System.out.println(user);
    }
}
